<?php
defined("ACCESS_ZYG") or exit("access invalid");
class adminModel extends dbo{
    protected $table = 'admin';
    public function checkAdmin($admin_name,$admin_password){
        $admin_name = addslashes($admin_name);
        $admin_password = md5($admin_password);
        $sql = "select * from {$this->getTable()} where admin_name='$admin_name' and admin_password='$admin_password'" ;
        return $this->queryRow($sql);
    }
    public function updateInfo($admin_id){
        $time = time();
        $sql = "update {$this->getTable()} set login_time = '$time'";
        $this->Update($sql);
    }
    public function getAdminById($admin_id){
        $sql = "select * from {$this->getTable()} where admin_id = '$admin_id'";
        return $this->queryRow($sql);
    }

}